import 'package:equatable/equatable.dart';
import 'package:mobile_app.core/core/domain/entities/purchase_item_type.dart';

class PremiumAccessInfo extends Equatable {
  const PremiumAccessInfo({
    this.purchaseItemType,
    this.subscriptionExpirationTime,
    this.demoExpirationTime,
  });

  final PurchaseItemType? purchaseItemType;
  final DateTime? subscriptionExpirationTime;
  final DateTime? demoExpirationTime;

  @override
  List<Object?> get props {
    return [
      purchaseItemType,
      subscriptionExpirationTime,
      demoExpirationTime,
    ];
  }

  PremiumAccessInfo copyWith({
    PurchaseItemType? Function()? purchaseItemType,
    DateTime? Function()? subscriptionExpirationTime,
    DateTime? Function()? demoExpirationTime,
  }) {
    return PremiumAccessInfo(
      purchaseItemType: purchaseItemType == null ? this.purchaseItemType : purchaseItemType(),
      subscriptionExpirationTime: subscriptionExpirationTime == null
          ? this.subscriptionExpirationTime
          : subscriptionExpirationTime(),
      demoExpirationTime:
          demoExpirationTime == null ? this.demoExpirationTime : demoExpirationTime(),
    );
  }
}
